-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow cross-compiling doctests #60387
Conversation
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
r? @kennytm |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Awaiting review, all checks pass now. |
|
☔ The latest upstream changes (presumably #61027) made this pull request unmergeable. Please resolve the merge conflicts. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@kennytm I have restricted the scope of this PR to only adding runtool functionality to rustdoc, along with Cargo in the other PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are those ignore
changes still in the scope of this PR? They're still in the diff.
Yes ignore is still a part of this PR, since being able to ignore on a per-target basis is relevant to using the crosscompilation feature. |
🤔 It's better to delegate the review to @rust-lang/rustdoc then, as it is changing the behavior of |
Sorry, how would that behavior change? |
@Goirad yeah that's what the "insta-stable" comment in #60387 (comment) is about. |
ping from triage -
|
☔ The latest upstream changes (presumably #62855) made this pull request unmergeable. Please resolve the merge conflicts. |
Just to be sure: shouldn't it be done over #63827 considering they'll make doctests run outside of rustdoc? |
This PR has been open for months, if @ollie27 is not available for review, can the docs team appoint a different reviewer? |
Sorry for the delay. As far as I'm concerned this feature and code looks good so r=me with a rebase. This could do with some tests like We also need tracking issues for the new features. |
updated and augmented tests in html/markdown.rs
…e at argument parsing time if no --target arguments
ed7e510
to
4a2094c
Compare
Thanks, lets get this in. @bors r+ |
📌 Commit 4a2094c has been approved by |
Allow cross-compiling doctests This PR allows doctest to receive a --runtool argument, as well as possibly many --runtool-arg arguments, which are then used to run cross compiled doctests. Also, functionality has been added to rustdoc to allow it to skip testing doctests on a per-target basis, in the same way that compiletest does it. For example, tagging the doctest with "ignore-sgx" disables testing on any targets that contain "sgx". A plain "ignore" still skips testing on all targets. See [here](rust-lang/cargo#6892) for the companion PR in the cargo project that extends functionality in Cargo so that it passes the appropriate parameters to rustdoc when cross compiling and testing doctests. Part of [#6460](rust-lang/cargo#6460)
☀️ Test successful - checks-azure |
Added ability to crosscompile doctests This commit adds the ability to cross-compile and run doctests. Like before cargo checks if target == host, the difference is that if there is a runtool defined in config.toml, it passes the information forward to rustdoc so that it can run the doctests with that tool. If no tool is defined and the target != host, cargo instead displays a message that doctests will not be compiled because of the missing runtool. See [here](rust-lang/rust#60387) for the companion PR in the rust project that modifies rustdoc to accept the relevant options as well as allow ignoring doctests on a per target level. Partially resolves [#6460](#6460) See [here](#7040) for the tracking issue.
This PR allows doctest to receive a --runtool argument, as well as possibly many --runtool-arg arguments, which are then used to run cross compiled doctests.
Also, functionality has been added to rustdoc to allow it to skip testing doctests on a per-target basis, in the same way that compiletest does it. For example, tagging the doctest with "ignore-sgx" disables testing on any targets that contain "sgx". A plain "ignore" still skips testing on all targets.
See here for the companion PR in the cargo project that extends functionality in Cargo so that it passes the appropriate parameters to rustdoc when cross compiling and testing doctests.
Part of #6460